package com.buer.storage.dao;

import com.buer.storage.dto.*;
import com.buer.storage.entity.Dorder;
import com.buer.storage.entity.DorderDO;
import com.buer.storage.entity.Stock;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public interface DorderDao {
    //查询所有库存
    List<Stock> findStock();
    List<Dorder> selectByAll(Map<String, Object> map);

    //订单
    int insertOrder(OutStorageDto outStorageDto);

    int insertBatch(DorderdetailsDto dorderdetailsDto);
    int updateBatch(BatchOrderDto batchOrderDto);
    int deleteBatch(BatchOrderDto batchOrderDto);

    Stock selectStockId(Integer stockId);
    //商品
    int insertDetails(@Param(value="arrary") DorderdetailsDto[] outProds);

    int updateAwaitNum(Stock stock);
    int updateR(DorderdetailsDto dorderdetailsDto);
    //查询订单表
    List<DorderDto> findOrderAll();
    //查询入库表
    List<OutStorageAllDto> findOutAll(Integer outId);

    //List<DorderdetailsDto> queryOrderDetailInfoByOutId(Integer outId);

    //根据订单id删除商品信息
    int deleteOutStorageById(int outId);

    //根据商品表id删除商品信息
    int deleteDorderdetails(int deliveryId);

    void deleteDorderByOutId(Integer outId);
    void deleteDorderDetailsByOutId(Integer outId);

    Stock queryBuerStockByParam(DorderdetailsDto outProd);

    int updateAddSumStock(Stock stock);

    //void insertStock2(Dorderdetails putProd);
    //查询入库表

    DorderdetailsDto[] findOrderDetailInfoByOutId(Integer outId);

    DorderdetailsDto[] findDordertailsAll(Integer outId);

//    DorderdetailsDto[] findDorder(Integer deliveryId);

    int deleteStock(int stockId);

    int updateStatus (int outId);

    List<DorderDto> getDord(Map<String, Object> map);

    List<DorderdetailsDto> getDorderdetails(Map<String, Object> map);

    List<StockDto> getDate(Map<String, Object> map);

    Dorder getOne(Map<String, Object> map);

    int save(DorderDO dorder);

    DorderDO get(Integer outId);

    int update(OutBatchOrderDto outBatchOrderDto);

}
